package info.techgeek.labs.java5Features.autoBoxing;

import java.util.AbstractList;
import java.util.List;

public class AutoBoxing1 {
	public static List<Integer> asList(final int[] a) {
	    return new AbstractList<Integer>() {
	        public Integer get(int i) { return a[i]; }
	        // Throws NullPointerException if val == null
	        public Integer set(int i, Integer val) {
	            Integer oldVal = a[i];
	            a[i] = val;
	            return oldVal;
	        }
	        public int size() { return a.length; }
	    };
	}
}
